Visualización de datos con Python¶

Se comparan distintas librerías para visualizar datos en Python.

Se trabaja con el conjunto de datos hprice3, creado por Jeffrey M. Wooldridge. El dataset contiene los precios de 321 viviendas, así como otras 18 variables con información sobre las características de las mismas.

Tabla de contenidos¶

  • Configuración inicial
  • Matplotlib
  • Seaborn
  • Plotnine
  • Plotly
  • Bokeh
  • Altair
  • Pygal

Configuración inicial ¶

Se carga el conjunto de datos con el que se trabajará y se realizan algunas transformaciones necesarias para las siguientes secciones:

In [1]:
#Desactivar warnings
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter(action='ignore', category=Warning)

#Carga de datos inicial
import pandas as pd
datos = pd.read_excel("hprice3.xlsx")

#Nuevas variables
datos["Bathrooms"] = datos["baths"]
datos["Area (sqft)"] = datos["area"]
datos["Log Price ($)"] = datos["log_price"]
datos["Neighborhood"] = datos["neighborhood"].astype(str)
datos["Year"] = datos["year"].astype(str)
datos["neighborhood_str"] = datos["neighborhood"].astype(str)

#Datos en formato largo
tabla = pd.crosstab(datos[datos["neighborhood"] != 0]["neighborhood"], datos['baths'])
datos_largo = tabla.melt()
datos_largo["neighborhood"] = list(range(1, 7))*4
datos_largo["Neighborhood"] = list(range(1, 7))*4
datos_largo["Baths"] = datos_largo["baths"].astype(str)
datos_largo["baths"] = datos_largo["baths"].astype(str)
datos_largo["Frequency"] = datos_largo["value"]

#Paleta de colores
colores = ["paleturquoise", "lightskyblue", "royalblue", "blue"]
colores_bp = ['steelblue', 'salmon']

Matplotlib ¶

Matplotlib es una biblioteca para la generación de gráficos con Python. Actualmente es la librería más popular para la visualización de datos.

A continuación, se crean un gráfico de dispersión, un diagrama de cajas (o boxplot) y un gráfico de barras apiladas para representar las relaciones entre distintos tipos de variables.

In [2]:
import matplotlib.pyplot as plt

# Gráfico de dispersión
plt.figure()
for neighborhood in sorted(datos["neighborhood"].unique()):
    neigh_data = datos[datos["neighborhood"] == neighborhood]
    plt.scatter(x=neigh_data["area"],
                y=neigh_data["log_price"],
                label=neighborhood,
                alpha=0.95,
                marker=".",
                cmap='Set2'
                )

plt.title("Area of the house and selling price by neighborhood")
plt.xlabel('Area (sqft)')
plt.ylabel('Log Price ($)')
plt.legend(title='Neighborhood', loc=4)
plt.show()

# Boxplot
plt.figure()
bp = plt.boxplot(x=[datos[datos["year"] == 1978]["log_price"], datos[datos["year"] == 1981]["log_price"]],
                 labels=["1978", "1981"],
                 patch_artist=True
                 )

plt.title('Selling prices by year')
plt.xlabel('Year')
plt.ylabel('Log Price ($)')


for patch, color in zip(bp['boxes'], colores_bp):
    patch.set_facecolor(color)
for median in bp['medians']:
    median.set(color='black',
               linewidth=2)
plt.show()

# Gráfico de barras
plt.figure()
bott = 0
for baths in sorted(datos["baths"].unique()):
    plt.bar(sorted(datos[datos["neighborhood"] != 0]["neighborhood"].unique()),
            pd.crosstab(datos[datos["neighborhood"] != 0]["neighborhood"], datos['baths'])[baths],
            bottom=bott,
            label=f'{baths}',
            color=colores[baths-1],
            edgecolor='black')
    bott = bott + pd.crosstab(datos[datos["neighborhood"] != 0]["neighborhood"], datos['baths'])[baths]
plt.title('Number of bathrooms in the house by neighborhood')
plt.xlabel('Neighborhood')
plt.legend(title='Bathrooms', loc=1)
plt.show()
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

Seaborn ¶

Seaborn es una librería basada en Matplotlib, orientada a gráficos estadísticos.

In [3]:
import seaborn as sns

# Gráficos de dispersión
plt.figure()
sns.scatterplot(data=datos,
                x="area",
                y="log_price",
                hue="neighborhood",
                palette="deep"
                )
plt.title("Area of the house and selling price by neighborhood")
plt.xlabel('Area (sqft)')
plt.ylabel('Log Price ($)')
plt.legend(title='Neighborhood', loc=4)
plt.show()

# Boxplot
plt.figure()
sns.boxplot(data=datos, x="year", y="log_price",
            palette=colores_bp,
            width=0.25)
plt.title('Selling prices by year')
plt.xlabel('Year')
plt.ylabel('Log Price ($)')
plt.show()

# Gráfico de barras
plt.figure()
sns.histplot(
    data=datos[datos["neighborhood"] != 0],
    x="neighborhood",
    hue="Bathrooms",
    multiple="stack",
    discrete=True,
    shrink=0.8,
    palette=colores
)
plt.title('Number of bathrooms in the house by neighborhood')
plt.xlabel('Neighborhood')
plt.show()
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

Plotnine ¶

plotnine es una implementación de una gramática de gráficos en Python, basada en el paquete ggplot2 de R.

In [4]:
from plotnine import (
    ggplot,
    aes,
    geom_point,
    geom_boxplot,
    geom_bar,
    theme_bw,
    theme_gray,
    theme_classic,
    labs,
    scale_fill_brewer
)

# Gráfico de dispersión
p = (
    ggplot(datos, aes("area", "log_price", color="neighborhood_str"))
    + geom_point()
    + labs(x='Area (sqft)',
           y='Log Price ($)',
           color="Neighborhood",
           title="Area of the house and selling price by neighborhood")
    + theme_bw()
)
print(p)
# Boxplot
p = (
    ggplot(datos)
    + geom_boxplot(aes(x="factor(year)",
                       y="log_price",
                       fill="factor(year)"
                       ))
    + labs(x="Year",
           y='Log Price ($)',
           title="Selling prices by year")
    + theme_gray()
)
print(p)

# Gráfico de barras
p = (
    ggplot(datos[datos["neighborhood"] != 0])
    + geom_bar(aes(x="neighborhood", fill="factor(baths)"), color="black")
    + labs(x="Neighborhood",
           fill="Bathrooms",
           title="Number of bathrooms in the house by neighborhood")
    + scale_fill_brewer()
    + theme_classic()
)
print(p)
No description has been provided for this image

No description has been provided for this image

No description has been provided for this image

Plotly ¶

Plotly es una librería que permite crear visualizaciones gráficas interactivas.

In [5]:
import plotly.express as px

# Gráfico de dispersión
fig = px.scatter(datos.sort_values(by="neighborhood"),
                 x="area",
                 y="log_price",
                 color="neighborhood_str",
                 color_discrete_sequence=px.colors.qualitative.Set1,
                 symbol="neighborhood_str",
                 hover_name="price",
                 width=800,
                 height=800,
                 labels={
    "area": "Area (sqft)",
    "log_price": "Log Price ($)",
    "neighborhood_str": "Neighborhood"
}
)
fig.update_layout(title="Area of the house and selling price by neighborhood")
fig.update_traces(
    hovertemplate='Area: %{x} sqft<br>Price: $%{hovertext} <br><extra></extra>'
)
fig.show()

# Boxplot
fig = px.box(datos,
             x="year",
             y="log_price",
             color="year",
             color_discrete_sequence=colores_bp,
             width=800,
             height=800,
             labels={
                 "year": "Year",
                 "log_price": "Log Price ($)"
             }
             )
fig.update_layout(title="Selling prices by year")
fig.show()

# Gráfico de barras
fig = px.bar(datos_largo,
             x="neighborhood",
             y="value",
             color="baths",
             color_discrete_sequence=colores,
             width=800,
             height=800,
             labels={
                 "neighborhood": "Neighborhood",
                 "value": "Count",
                 "baths": "Bathrooms"
             }
             )

fig.update_layout(title="Number of bathrooms in the house by neighborhood")
fig.show()

Bokeh ¶

Bokeh es otra librería que permite crear visualizaciones interactivas. En este caso, la librería no permite realizar boxplots.

In [6]:
import bokeh.palettes
from bokeh.transform import factor_cmap
from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook

# Gráfico de dispersión
colores_cmap = factor_cmap('neighborhood_str', palette=bokeh.palettes.Set3[7],
                      factors=sorted(datos.neighborhood_str.unique()))

graph = figure(title="Area of the house and selling price by neighborhood")
graph.scatter("area", "log_price", source=datos,
              size=12.5, 
              fill_alpha=0.6,
              color="black", 
              fill_color=colores_cmap,
              legend_group='neighborhood_str'
              )
graph.xaxis.axis_label = 'Area (sqft)'
graph.yaxis.axis_label = 'Log Price ($)'
graph.legend.title = 'Neighborhood'
graph.legend.location = "bottom_right"
output_notebook()
show(graph)

# Gráfico de barras
neighborhood = ['1', '2', '3', '4', '5', '6']
baths = ['1', '2', '3', '4']
datos_barras = {'neighborhood': neighborhood,
                '1': tabla[1],
                '2': tabla[2],
                '3': tabla[3],
                '4': tabla[4]
                }

graph = figure(title="Number of bathrooms in the house by neighborhood",
               x_range=neighborhood, 
               tooltips="Frequency: @$name")
graph.vbar_stack(baths, x='neighborhood',
                 width=0.9,
                 color=colores,
                 source=datos_barras,
                 legend_label=baths
                 )

graph.xaxis.axis_label = 'Neighborhood'
graph.yaxis.axis_label = 'Frequency'
output_notebook()
show(graph)
Loading BokehJS ...
Loading BokehJS ...

Altair ¶

Vega-Altair implementa la gramática de gráficos Vega-Lite, similar a ggplot2. Así como Plotly o Bokeh, pemite crear visualizaciones interactivas.

In [7]:
import altair as alt
alt.renderers.enable('html')

# Gráfico de dispersión
chart = alt.Chart(datos, title="Area of the house and selling price by neighborhood").mark_circle(size=60).encode(
    alt.X('Area (sqft)').scale(zero=False),
    alt.Y('Log Price ($)').scale(zero=False),
    color='Neighborhood',
    tooltip=["Area (sqft)", "Log Price ($)", "Neighborhood"]
).interactive()
chart.display()

# Boxplot
chart = alt.Chart(datos, title="Selling prices by year").mark_boxplot(size=50).encode(
    alt.X('Year').scale(zero=False),
    alt.Y('Log Price ($)').scale(zero=False),
    alt.Color("Year").scale(scheme="set1").legend(None),
).properties(
    width=250
)
chart.display()

# Gráfico de barras
chart = alt.Chart(datos_largo, title="Number of bathrooms in the house by neighborhood").mark_bar(size=30).encode(
    x='Neighborhood',
    y='Frequency',
    order=alt.Order('Neighborhood', sort='ascending'),
    color=alt.Color('Baths').scale(scheme="blues"),
    tooltip=["Neighborhood", "Baths", "Frequency"]
)
chart.display()

Pygal ¶

pygal es una librería para crear gráficos en formato SVG.

In [8]:
import pygal
from pygal.style import Style


# Gráfico de dispersión
chart1 = pygal.XY(stroke=False)
chart1.title = 'Area of the house and selling price by neighborhood'
chart1.x_title = 'Area (sqft)'
chart1.y_title = 'Log Price ($)'

for x in range(0, 7):
    serie = list(zip(
        datos[datos["neighborhood"] == x]["area"].values,
        datos[datos["neighborhood"] == x]["log_price"].values
    ))
    chart1.add(str(x), serie)
    pass

display(chart1)

# Boxplot
chart2 = pygal.Box(box_mode="tukey")
chart2.title = 'Selling prices by year'
chart2.x_title = 'Year'
chart2.y_title = 'Price ($)'
chart2.add("1978", datos[datos["year"] == 1978]["price"].values)
chart2.add("1981", datos[datos["year"] == 1981]["price"].values)

display(chart2)

# Gráfico de barras
estilo = Style(colors=(colores))

chart3 = pygal.StackedBar(style=estilo)
chart3.title = 'Number of bathrooms in the house by neighborhood'
chart3.x_title = 'Neighborhood'
chart3.x_labels = list(range(1, 7))

for x in range(1, 5):
    chart3.add(str(x), tabla[x].values)
    pass

display(chart3)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

Los gráficos estáticos previamente creados también pueden presentarse como representaciones interactivas:

In [9]:
# Configurar formato HTML
from IPython.display import display, HTML
base_html =  u"""
    <!DOCTYPE html>
    <html>
        <head>
            <script type="text/javascript" src="http://kozea.github.com/pygal.js/javascripts/svg.jquery.js"></script>
            <script type="text/javascript" src="http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js"></script>
        </head>
        <body><figure>{rendered_chart}</figure></body>
    </html>
"""

# Mostrar los gráficos
display(HTML(base_html.format(rendered_chart=chart1.render(is_unicode=True))))
display(HTML(base_html.format(rendered_chart=chart2.render(is_unicode=True))))
display(HTML(base_html.format(rendered_chart=chart3.render(is_unicode=True))))
Area of the house and selling price by neighborhood10.210.210.410.410.610.610.810.8111111.211.211.411.411.611.611.811.8121212.212.212.412.412.612.61000100020002000300030004000400050005000Area of the house and selling price by neighborhoodArea (sqft)Log Price ($)1482: 10.6213274122.15960358659743391.22753775652471290: 10.8376178794.07088249174137349.729924677722351274: 10.8589992591.7301557338367345.62768132694251476: 10.79957581121.28183105238318357.028697526188472071: 10.49127388208.32760736196315416.179679950510832352: 11.40756512249.43662104766395240.37952323006891750: 11.11095428161.36677678150068297.28744583114261038: 10.7789564157.20443605474279360.984745853004372089: 11.05088997210.9609249646059308.811419547413831464: 10.37349129119.5262859839547438.77751504393792112: 10.37349129214.32571967909388438.77751504393791964: 11.31447411192.67399716847567258.240017440578871166: 10.8395805475.93025011798017349.35336728183082252: 11.51292515234.80707881075975220.16508786399312598: 11.78676224285.4252949504483167.626548457235692276: 10.53209591238.31816894761678408.34754227744552032: 10.9490509202.6220858895705328.350320459829051318: 11.0348892298.16715431807455311.881332078161561078: 10.7789564163.05625294950446360.984745853004371421: 10.9490509113.23558282208587328.35032045982905990: 10.4341154150.18225578102878427.146136472766443792: 11.49272251460.10202925908436224.04117721024262544: 11.35627174277.52534214252250.220698904541542206: 11.71586609228.0774893817838181.228723778241432038: 11.19821453203.49985842378476280.545645458575561924: 11.34922981186.822180273714251.57176781186272370: 11.30096912252.0699386503067260.831090950408852036: 11.4510498203.2072675790467232.036526349359351818: 11.2185545171.31486550259552276.6432080729622952: 11.36210251337.21387446908915249.10200506659892800: 11.45504189314.97697026899476231.270603482883932108: 11.41310501213.7405379896177239.316636003275822208: 11.41310501228.3700802265219239.316636003275821560: 11.34922981133.57064653138272251.57176781186272248: 11.36210251234.2218971212836249.10200506659891868: 11.19821453178.6296366210476280.545645458575561100: 10.8097276766.27475224162339355.080955310797261320: 10.9508066298.45974516281262328.013468095475453030: 11.6952467348.6249174138744185.184772105056941924: 11.33260155186.822180273714254.762076244699413770: 12.61153793456.883529966965459.3846153846153582856: 11.08060265323.1695139216611303.110728475296471333: 10.88743687100.36158565361018340.17162448140892727: 11.08214283304.2974044360547302.815227894943062080: 11.1968441209.64426616328453280.8085769347152030: 10.16585159202.32949504483244478.615384615384643030: 11.6699295348.6249174138744190.042142945072952252: 11.4824667234.80707881075975226.008863427650062238: 11.46163177232.7589428975932230.006263538465762464: 11.58895969265.8217083529966205.577056736831762464: 11.6952467265.8217083529966185.184772105056942502: 11.6952467271.38093440302026185.184772105056942510: 11.70354557272.5512977819726183.59254544856732012: 11.58058453199.69617744218968207.183921192966752352: 11.69441319249.43662104766395185.344690066189062492: 11.8670969269.91798017932985152.213494347530122756: 11.34108067308.53997168475695253.135267786546171592: 11.21046829138.25210004719204278.19463186293821910: 11.67419338184.7740443605474189.22407291735988735: 11.0020999912.876923076923072318.17229242100281154: 11.3504066574.17470504955166251.34597975232311104: 11.1046409666.85993393109956298.498723751845832258: 11.69441319235.68485134497402185.344690066189062016: 11.73606873200.28135913166585177.3526344319921991: 11.67844009196.6239735724398188.409296394566131746: 11.51292515160.7815950920245220.16508786399312700: 11.75978565300.34742803209053172.802291439551942302: 11.84939766242.12184992921183155.609280892895922144: 11.87409019219.00717319490323150.871757037481871140: 10.8197784472.12656913638507353.15260817993897912: 11.0821428338.7712128362435302.815227894943061425: 11.36210251113.82076451156203249.10200506659893798: 11.6952467460.97980179329863185.184772105056942252: 11.81303024234.80707881075975162.586754039133272252: 11.81303024234.80707881075975162.586754039133272836: 11.98292923320.2436054742803129.989838007550422486: 12.03171921269.0402076451156120.628965133961463074: 12.11228371355.0619159981122105.171814652821133074: 12.07254124355.0619159981122112.796827460896453232: 11.99535179378.1765927324209127.60643828019713396: 12.15402603402.169042000943897.163108521527142464: 12.15744972265.821708352996696.50623726241443252: 12.36543274381.102501179801756.602497592562263040: 12.30138302350.0878716375648368.891113367838953055: 12.07254124352.28230297310046112.796827460896451731: 11.67844009158.58716375648888188.409296394566131531: 11.25026131129.32807928268048270.55992151259742574: 11.79055691281.91420481359125166.89850089734492644: 11.77528954292.1548843794242169.827707578997151456: 11.22524357118.35592260500233275.35983898900342464: 11.96081161265.8217083529966134.233336124914442400: 11.84939766256.45880132137796155.609280892895921760: 11.08214283162.8297310051911302.815227894943063132: 11.91839027363.54705049551666142.372318673057462688: 11.95118046298.59188296366204136.081175357719992000: 11.63955784197.9406323737612195.869268011632982580: 12.06046867282.7919773478055115.113076282374322738: 12.08816147305.9066540821142109.799920955881992208: 11.73606873228.3700802265219177.3526344319922900: 12.06393242329.60651250589893114.448520178447153292: 12.03765392386.9543180745634119.49032729400092472: 12.03142166266.99207173194895120.686052552581032569: 11.88448906281.18272770174605148.876624945738572464: 11.98230362265.8217083529966130.109867964646922826: 12.05680084318.78065125058987115.8167885003522464: 11.96336365265.8217083529966133.743701726756172832: 12.04296494319.6584237848041118.471353466147721848: 11.65268707175.70372817366678193.350285665058271549: 11.40756512131.96139688532327240.37952323006893334: 12.50617695393.0987258140631329.5992337231873531526: 11.15625095128.59660217083527288.596801208841841197: 11.4927225180.46540821142047224.04117721024261836: 11.5511837173.9481831052383212.82478025903232856: 11.5238657323.1695139216611218.066027394761481836: 11.58895969173.9481831052383205.577056736831761842: 12.07254124174.82595563945253112.796827460896452384: 11.28978157254.11807456347327262.977541295992641388: 11.00209999108.40783388390749318.17229242100281296: 11.482466794.94865502595563226.008863427650061148: 11.4616317773.29693251533742230.006263538465762261: 12.22626781236.1237376120811683.30275900926583861: 11.32659626470.1964134025483255.91425404933155078: 12.12811089648.2379424256725102.13520311626691358: 11.11988258104.01897121283623295.574457327575432171: 11.6952467222.95714959886735185.184772105056941998: 11.27720356197.6480415290231265.39076554012391998: 11.2580328197.6480415290231269.068878646162151356: 10.96819782103.72638036809815324.67678166618021411: 11.0332756111.77262859839546312.190921540673571540: 11.2885313130.64473808400186263.217418237691051296: 11.041320894.94865502595563310.6473655680082240: 11.40199375233.05153374233126241.44844854921392781: 11.90496731312.197357243983144.947656548268471537: 11.22524357130.20585181689472275.35983898900342796: 11.4119997314.3917885795186239.528701125647642794: 11.73606873314.0991977347805177.3526344319921684: 11.12726307151.71127890514393294.15843318432432996: 11.95118046343.650873053327136.081175357719992464: 11.87756824265.8217083529966150.204456346122472548: 12.28303337278.110523831996272.411687155186883398: 11.73206139402.4616328456819178.12148485839591988: 11.28978157196.18508730533267262.977541295992645136: 11.51292515656.7230769230769220.16508786399311564: 11.19821453134.1558282208589280.545645458575562248: 11.84939766234.2218971212836155.609280892895921566: 11.31447411134.44841906559697258.240017440578872744: 12.10071182306.7844266163284107.392002914121292470: 12.20607281266.699480887210987.177384575550952346: 10.53209591248.55884851344973408.34754227744551215: 10.9852924383.09872581406322321.39699968300862128: 10.98529243216.66644643699854321.39699968300862290: 11.4510498240.36630486078334232.036526349359352464: 11.47126961265.8217083529966228.157143498188472240: 11.46163177233.05153374233126230.006263538465762464: 11.47106171265.8217083529966228.197031502224432240: 11.41861439233.05153374233126238.25960389634182464: 11.48143482265.8217083529966226.20683966786131360: 11.08214283104.3115620575743302.815227894943061940: 11.40756512189.16290703161866240.37952323006892816: 11.55694199317.31769702689945211.719992330753661235: 11.0508899786.02463426144406308.811419547413831388: 11.09892368108.40783388390749299.595643862815451070: 11.0020999961.88588957055213318.17229242100281390: 11.19821453108.70042472864556280.545645458575562574: 11.32659626281.91420481359125255.91425404933152284: 11.4240942239.48853232656907237.208243936771252632: 11.40658665290.3993393109957240.567253010527962632: 11.38509178290.3993393109957244.691270088280851936: 11.20504093188.5777253421425279.23592833525292004: 11.35040665198.52581406323736251.34597975232311920: 11.37366295186.23699858423782246.884012475244562136: 11.4824667217.8368098159509226.008863427650062472: 11.1913414266.99207173194895281.864328234180731792: 11.25156116167.51118452100044270.310530001129732136: 11.35040665217.8368098159509251.34597975232312016: 11.31447411200.28135913166585258.240017440578872514: 11.44035435273.13647947144875234.088562887227652432: 11.56171608261.1402548371873210.80403201790792878: 11.57590008326.38801321378208.08268209122891080: 11.3504066563.34884379424255251.34597975232311286: 11.2960128893.4857008022652261.781999009908651344: 11.23717213101.97083529966963273.0712190143581232: 11.5991029785.58574799433693203.63096127390114056: 11.98292923498.72402076451147129.989838007550422364: 11.6952467251.19216611609244185.184772105056942377: 11.81967449253.09400660689161.311984662466332056: 11.77451992206.13317602642752169.975366382925762632: 11.60732651290.3993393109957202.053189444562862528: 11.6952467275.18461538461537185.184772105056941800: 11.84939766168.6815478999528155.609280892895921182: 11.3265962678.27097687588484255.91425404933152738: 12.07254124305.9066540821142112.796827460896452016: 11.67419338200.28135913166585189.224072917359882610: 11.95440102287.1808400188768135.463277240165672627: 11.97035027289.6678621991505132.40324522417802960: 10.7121934945.79339310995751373.7939183781891296: 10.7472076494.94865502595563367.076083203173541668: 10.81977844149.37055214723924353.152608179938972052: 11.40756512205.54799433695135240.37952323006892648: 11.80185699292.7400660689004164.730459797282662464: 11.75978565265.8217083529966172.802291439551941998: 11.56171608197.6480415290231210.80403201790791660: 11.00209999148.20018876828692318.17229242100282612: 10.59663486287.47343086361485395.96506161193851144: 10.4341154172.71175082586124427.146136472766441136: 11.0650749271.54138744690891306.08988664823861868: 10.69194508178.6296366210476377.678790404226731780: 10.73639679165.75563945257196369.150259413005641700: 10.93310738154.0520056630486331.40925464084331556: 10.55841351132.98546484190655403.298233289572241642: 11.01039886145.56687116564413316.58006576451521443: 10.91508865116.45408211420478334.866336972227261439: 10.57131672115.86890042472864400.822615424449051838: 11.28978157174.24077394997636262.977541295992641536: 10.81977844130.05955639452569353.152608179938972458: 10.98529243264.9439358187824321.3969996830086750: 10.6454248415.071354412458703386.60418873834952106: 11.17745304213.44794714487963284.5289566872311000: 10.668955851.645210004719196382.08952538254481410: 10.77895641111.6263331760264360.984745853004372576: 10.7579031282.2067956583294365.02404666530521377: 11.1345892106.79858423784802292.752838473321961869: 10.69194508178.77593204341667377.678790404226731490: 10.68051624123.32996696554977379.87153279119041867: 10.59663486178.48334119867857395.96506161193851261: 10.7363967989.82831524303916369.150259413005641800: 11.01862907168.6815478999528315.001013127706871972: 10.92413807193.84436054742798333.13011096172081875: 10.79957581179.65370457763092357.028697526188471570: 10.89673901135.03360075507314338.38691075957493460: 10.77895641411.53194903256247360.984745853004371592: 10.87804699138.25210004719204341.97317167283404915: 10.7995758139.21009910335063357.02869752618847925: 10.3417425240.673053327041046444.86885239410947930: 10.8376178741.404530438886255349.729924677722351399: 11.01039886110.01708352996694316.58006576451521342: 11.1619482101.67824445493154287.503723520280351500: 10.77895641124.79292118924019360.984745853004371554: 10.79957581132.69287399716848357.028697526188471575: 10.85899925135.76507786691835345.62768132694253304: 11.12726307388.7098631429919294.15843318432431700: 10.89673901154.0520056630486338.38691075957491454: 11.15625095118.06333176026426288.596801208841841410: 10.7579031111.6263331760264365.02404666530521830: 11.15625095173.07041057102404288.596801208841841166: 11.1049575875.93025011798017298.437976883314432263: 11.41861439236.41632845681923238.25960389634181482: 11.1913414122.15960358659743281.86432823418073970: 11.1124477447.25634733364793297.00091090307361633: 11.57119465144.25021236432275208.985468384391883208: 11.77528954374.6655025955639169.827707578997151867: 11.10495758178.48334119867857298.437976883314432327: 11.38509178245.7792354884379244.69127008828085936: 10.621327442.28230297310051391.22753775652471674: 11.0974102150.2483246814535299.886021213290751587: 11.2118206137.52062293534684277.93517686421431133: 11.0348892271.10250117980179311.881332078161561242: 11.4798860587.04870221802736226.503987000673532216: 11.28351212229.54044360547425264.180402481898451226: 11.4917020884.70797546012268224.23695778050661910: 11.5511837184.7740443605474212.82478025903231728: 11.15625095158.14827748938174288.596801208841841986: 11.32055378195.8924964605946257.073567781291331855: 11.36210251176.72779613025008249.10200506659891836: 11.25026131173.9481831052383270.55992151259741836: 11.23717213173.9481831052383273.0712190143581820: 11.23188782171.60745634733362274.08506961233641728: 11.22524357158.14827748938174275.35983898900342092: 11.21046829211.39981123171302278.19463186293822036: 11.33738136203.2072675790467253.845018096879532400: 11.25026131256.45880132137796270.55992151259742104: 11.34213734213.15535630014156252.93253426144931928: 11.23717213187.40736196319014273.0712190143582067: 11.383955207.74242567248697244.909373303006281232: 11.1633682385.58574799433693287.231277474369562650: 11.6952467293.03265691363845185.184772105056941978: 11.04292202194.72213308164223310.340154747937851248: 11.089805687.92647475224162301.34504389300291716: 11.34922981156.39273242095325251.57176781186271144: 11.0572195172.71175082586124307.59703109428582450: 11.28978157263.77357243983005262.977541295992642706: 11.70354557301.2252005663048183.59254544856731978: 11.35040665194.72213308164223251.34597975232312756: 11.79810429308.53997168475695165.450456567368582576: 11.87059975282.2067956583294151.54143637128512528: 11.77528954275.18461538461537169.827707578997152464: 11.81303024265.8217083529966162.586754039133272920: 11.85651493332.53242095327977154.24375715842372548: 11.73606873278.1105238319962177.3526344319922436: 11.40199375261.7254365266635241.44844854921392384: 11.46057892254.11807456347327230.20826517357961862: 11.36093903177.75186408683336249.325231511198722036: 11.4392786203.2072675790467234.294955862234622082: 11.34922981209.9368570080226251.57176781186271962: 11.36093903192.38140632373756249.325231511198722286: 11.36093903239.7811231713072249.325231511198722464: 11.49170208265.8217083529966224.23695778050661862: 11.26957893177.75186408683336266.85363064224212738: 11.42300034305.9066540821142237.418113389195532240: 11.57590008233.05153374233126208.08268209122892780: 11.60367966312.0510618216139202.752876267639922872: 11.71993923325.51024067956575180.447248249642881357: 11.05088997103.87267579046718308.811419547413833256: 11.37939453381.6876828692779245.784347776842371844: 11.0974102175.11854648419063299.886021213290751764: 11.06663799163.41491269466727305.789994727992052656: 11.93819332293.9104294478527138.572894802453052738: 11.98292923305.9066540821142129.989838007550422736: 11.90496731305.6140632373761144.947656548268473726: 11.86358261450.44653138272764152.887747993722372656: 11.99535179293.9104294478527127.60643828019713284: 12.07539463385.78395469561104112.249373754137033170: 12.1756134369.106276545540393.02134311170382330: 11.77912807246.21812175554504169.091243284308921199: 10.8761587180.75799905615855342.335457214072562204: 11.60823536227.78489853704573201.878816656281342400: 11.12726307256.45880132137796294.15843318432433152: 11.40756512366.47295894289755240.37952323006893152: 11.5327282366.47295894289755216.36566399338872701: 11.69190788300.4937234544596185.825358812063543140: 11.88103485364.717413874469149.53935132470860123456
Selling prices by year002000020000400004000060000600008000080000100000100000120000120000140000140000160000160000180000180000200000200000220000220000240000240000260000260000280000280000300000300000Min: 26000 Lower Whisker: 26000 Q1: 56225 Q2: 75500 Q3: 90300 Upper Whisker: 131500 Max: 300000164.18076923076922374.64185897435897Min: 41000 Lower Whisker: 41000 Q1: 82000 Q2: 120000 Q3: 155000 Upper Whisker: 234552 Max: 270000468.21923076923065292.24588717948717Selling prices by yearYearPrice ($)19781981
Number of bathrooms in the house by neighborhood00101020203030404050506060123456270.30641025641026470.794871794871813183.70384615384614466.884615384615421297.10128205128206474.70512820512823325410.49871794871797380.8589743589743641523.8961538461539474.7051282051282352637.2935897435898470.79487179487186770.30641025641026435.6025641025641116183.70384615384614392.589743589743622297.10128205128206462.974358974359333410.49871794871797154.0641025641025748523.8961538461539439.51282051282055510637.2935897435898423.8717948717948661670.30641025641026345.66666666666663128183.70384615384614220.5384615384615224297.10128205128206439.5128205128205532410.4987179487179717.205128205128233418523.8961538461539337.8461538461538520637.2935897435898306.564102564102546270.30641025641026275.2820512820512710183.70384615384614111.0512820512820420297.10128205128206423.871794871794930410.498717948717979.38461538461541540523.8961538461539267.4615384615384550637.2935897435898228.358974358974366Number of bathrooms in the house by neighborhoodNeighborhood1234